pairs :: [Int] -> [[Int]]
pairs (x1:x2:xs) = [x1,x2] : pairs (x2:xs)
pairs _ = []

sumOfPairs :: [[Int]] -> [Int]
sumOfPairs = map sum

nextLine :: [Int] -> [Int]
nextLine xs = 1 : s ++ [1]
    where p = pairs xs
          s = sumOfPairs p
                                                                               
seqPascal :: Int -> [Int] -> [[Int]]
seqPascal 0 xs = []
seqPascal n xs = xs : seqPascal (n - 1) (nextLine xs)

pascalsTriangle :: Int -> [[Int]]
pascalsTriangle n 
    | n > 0 = seqPascal n [1]
    | otherwise = []
 
    
pascalsTriangleToStr :: [[Int]] -> String
pascalsTriangleToStr [] = []
pascalsTriangleToStr xxs = unlines $ map ln xxs
    where ln :: [Int] -> String
          ln [] = []
          ln xs = unwords $ map show xs
    
main = do
    l <- getLine
    let p = pascalsTriangle (read l)                
    putStr $ pascalsTriangleToStr p
    
    